<!DOCTYPE html>
<html lang="en">
<head>
    {{include file="lib/page_head" /}}
    <style>
        table th{word-wrap:break-word;word-wrap:break-word;word-break:break-all;font-size:12px!important;}
        table td{word-wrap:break-word;word-wrap:break-word;word-break:break-all;}
        #edit_info .form-beautify-select{display:block;width: 100%!important;}
        .form-group{margin-bottom: 5px!important;}
    </style>
</head>
<body >

<!-- Preloader -->
<div id="preloader" style="display: none;">
    <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
</div>

<section>
    {{include file="lib/page_left" /}}
    <div class="mainpanel">

        {{include file="lib/page_header" /}}

        <div class="contentpanel" >
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-btns">
                        <a href="" class="panel-close">×</a>
                        <a href="" class="minimize">−</a>
                    </div>
                    <h4 class="panel-title">系统操作日志</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline"  id="info_list">

                        <div class="btn-group">
                            <button class="btn btn-primary" type="button" onclick="location.href = location.href;">刷新</button>
                        </div>
                        <div class="layui-form-item search_tools" style="margin-top:10px;" >
                            <form class="layui-form" id="search_form" action="" onsubmit="return false;">

                                <div class="form-group">
                                    <label >时间</label>
                                    <input class="form-control" placeholder="开始日" name="date_1" id="date_1">
                                    <input class="form-control" placeholder="截止日" name="date_2" id="date_2">
                                </div>

                                <div style="display: inline-block;clear: both;">
                                    <button class="btn btn-primary" onclick="search()">查询</button>
                                    <button class="btn btn-default" onclick="search_reset()">取消</button>
                                </div>
                            </form>
                            <div class="well well-sm search_toogle"><span class="glyphicon glyphicon-chevron-down"></span></div>
                        </div>

                    </div>

                </div>
            </div>
        </div><!-- contentpanel -->

    </div><!-- mainpanel -->
    {{include file="lib/page_right" /}}
</section>

<script src="../js/jquery-1.11.1.min.js"></script>
<script src="../js/jquery-migrate-1.2.1.min.js"></script>
<script src="../js/jquery-ui-1.10.3.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.sparkline.min.js"></script>
<script src="../js/toggles.min.js"></script>
<script src="../js/jquery.cookies.js"></script>
<script src="../js/jquery.tmpl.js"></script>
<script src="../js/custom.js"></script>
<script src="../layui/layui.js"></script>
<script src="../js/jquery.gritter.min.js"></script>
<script src="../js/form.beautify.js?t={{$version}}"></script>
<script src="../js/commen.js?t={{$version}}"></script>
<script src="../js/datatables.js?t={{$version}}"></script>
<link href="../css/ley.dialog.css" rel="stylesheet">
<script src="../js/ley.dialog.js?t={{$version}}"></script>
<script>

    layui.use(['layer','laypage',"element","laydate"], function(){

        var laydate = layui.laydate;
        $("#search_form input[name='date_1']").val(new Date().Format("yyyy-MM-dd"));
        $("#search_form input[name='date_2']").val(new Date().Format("yyyy-MM-dd"));
        laydate.render({
            elem: '#date_1'
        });
        laydate.render({
            elem: '#date_2'
        });

        //全选
//        form.on('checkbox(allChoose)', function(data){
//            var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');
//            child.each(function(index, item){
//                item.checked = data.elem.checked;
//            });
//            form.render('checkbox');
//        });
        $("#info_list").datatables({
            rows:15,
            idField: 'id',
            columns:[
                {field:'ck',checkbox:true },
                {field:'id',title:'ID',width:120} ,
                {field:'module_name',title:'名称',width:100} ,

                {field:'content',title:'内容',width:120} ,
                {field:'real_name',title:'管理员',width:120} ,
                {field:'ip',title:'IP',width:120} ,
                {field:'ctime',title:'时间',width:120} ,
            ],
            ajax:{
                url:"/adminlist/ajax_sys_log",
                parems:get_search_data(),
                callback:function (msg) {

                    check_table_list_data(msg);
                    check_parent_height();

                }

            }

        });
    });


    function get_search_data()
    {
        var data = {};
        $('#search_form select,#search_form input').each(function () {
            var name = $(this).attr("name");
            if(name)
            {
                data[name] = $(this).val();
            }

        });

        return data;
    }
    function search()
    {
        var data = get_search_data();
        console.log(data)
        $("#info_list").setParems(data);
        $("#info_list").reload();
    }
    function search_reset() {
        $("#search_form")[0].reset();
        search();
    }


</script>

</body>
</html>